<!--
 * Copyright © 2022
 * @Author: zhangxiang
 * @Date: 2022-11-21 17:13:52
 * @LastEditors: zhangxiang
 * @LastEditTime: 2023-01-18 14:19:03
 * @Description:
 *
-->

<template>
  <MyContainer class="container">
    <MyHeader class="header">
      <el-input
        v-model="searchKey"
        style="width: 200px; margin-right: 20px"
        size="medium"
        class="input"
        placeholder="请输入关键字进行过滤"
        clearable
        @clear="clearClick"
        @keyup.enter.native="queryClick"
      />
      <el-button
        size="medium"
        type="primary"
        @click="queryClick"
      >查询</el-button>
      <el-button size="medium" @click="resetClick">重置</el-button>
    </MyHeader>
    <MyMain class="main">
      <el-table
        v-loading="loading"
        class="common-table"
        :data="list"
        stripe
        header-cell-class-name="listHeaderCell"
        :header-cell-style="{ color: '#696969' }"
      >
        <el-table-column
          prop="username"
          label="用户名"
          min-width="120"
          show-overflow-tooltip
        />
        <el-table-column
          prop="name"
          label="姓名"
          min-width="120"
          show-overflow-tooltip
        />
        <el-table-column
          prop="role"
          label="角色"
          min-width="120"
          show-overflow-tooltip
        />
        <el-table-column
          prop="company"
          label="单位"
          min-width="120"
          show-overflow-tooltip
        />
        <el-table-column
          prop="cpuCount"
          label="CPU核数"
          min-width="110"
          show-overflow-tooltip
        />
        <el-table-column
          prop="memSize"
          label="内存"
          min-width="110"
          show-overflow-tooltip
        />
        <el-table-column
          prop="disk"
          label="硬盘"
          min-width="110"
          show-overflow-tooltip
        />
        <el-table-column
          prop="nsg"
          label="安全组"
          min-width="100"
          show-overflow-tooltip
        />
        <el-table-column
          prop="net"
          label="虚拟网络"
          min-width="100"
          show-overflow-tooltip
        />
        <el-table-column
          prop="eip"
          label="弹性IP"
          min-width="100"
          show-overflow-tooltip
        />
        <el-table-column
          prop="fip"
          label="浮动IP"
          min-width="100"
          show-overflow-tooltip
        />
        <el-table-column
          prop="k8s"
          label="K8s集群数"
          min-width="100"
          show-overflow-tooltip
        />
        <el-table-column
          prop="apps"
          label="应用数"
          min-width="100"
          show-overflow-tooltip
        />
        <el-table-column label="操作" width="100">
          <template slot-scope="scope">
            <el-button
              type="primary"
              size="mini"
              style="height: 22px; padding: 0 10px"
              @click="editClick(scope.row)"
            >编辑</el-button>
          </template>
        </el-table-column>
      </el-table>
      <el-row type="flex" justify="end" style="margin-top: 30px">
        <el-pagination
          background
          layout="total, sizes, prev, pager, next"
          :page-sizes="[10, 15, 20]"
          :page-size="pageSize"
          :current-page.sync="pageNum"
          :total="totalCount"
          @current-change="changePage"
          @size-change="sizeChange"
        />
      </el-row>
    </MyMain>

  </MyContainer>
</template>

<script>
import pagePermissionMixin from '@/views/mixin/pagePermission.js'
import pageQueryMixin from '@/views/mixin/pageQuery.js'
import MyContainer from '@/components/Layout/MyContainer.vue'
import MyHeader from '@/components/Layout/MyHeader.vue'
import MyMain from '@/components/Layout/MyMain.vue'
import { getQuotaList } from '@/api/system-mgmt'

export default {
  name: 'SystemMgmtQuota',
  components: {
    MyContainer,
    MyHeader,
    MyMain
  },
  mixins: [pagePermissionMixin, pageQueryMixin],
  data() {
    return {}
  },
  created() {},
  methods: {
    editClick(row) {

    },
    /**
     * @description: 获取列表
     * @return {*}
     */
    getList() {
      this.handleRequestAndResp(getQuotaList, {
        keyword: this.searchKey,
        pageNum: this.pageNum,
        pageSize: this.pageSize
      })
    }
  }
}
</script>

<style lang="less" scoped>
@import "@/assets/css/common.less";
.container {
}
</style>
